Skip to content

Fix access of lazy vals in traits compiled by 2.12 #3070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Sep 5, 2017

This was a case we did not consider before. Accessing a lazy val defined
in a Scala 2.12 trait accessed an implementation class which did not exist.
We need special treatment to avoid this.

P.S. It might be preferable to change lazy vals to not generate implementation class
references in the first place. I don't know enough about its internals to be able
to say whether that's feasible.

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased and added a testcase thanks to the presence of lazy vals in the standard library. Hopefully at some point we can completely get rid of ImplClass since we no longer want to support 2.11.

This was a case we did not consider before. Accessing a lazy val defined
in a Scala 2.12 trait accessed an implementation class which did not exist.
need special treatment to avoid this.

P.S. It might be preferable to change lazy vals to not generate implementation class
references in the first place. I don't know enough about its internals to be able
to say whether that's feasible.
@smarter smarter merged commit 0baa6dc into scala:master Sep 27, 2017
@allanrenucci allanrenucci deleted the fix-2.12-lazy-vals branch December 14, 2017 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants